#TIME TO DO SOME ANALYSES

#R script for 9.17.2012
#Keewee, Koowoo, Kaawaa and differences

#if we're not in the right folder, setwd()
setwd('')
#load our data
load(file="keewee.diff.rda")


#some basic operations on the data
##mean of columns
mean(keewee.diff[,1])
mean(keewee.diff[,2])
mean(keewee.diff[,3])
##sd of columns
sd(keewee.diff[,1])
sd(keewee.diff[,2])
sd(keewee.diff[,3])

##the above were a waste of time!
###now use apply to go faster.
keewee.col.means <- apply(keewee.diff,2,mean)
keewee.col.sd <- apply(keewee.diff,2,sd)


#t-test formula
##sample.mean - pop.mean; or
##sample.mean - 0
###divided by
##sd * n

t.eo.numerator.1 <- mean(keewee.diff[,1]) 
t.eo.denominator.1 <- sd(keewee.diff[,1]) / sqrt(length(keewee.diff[,1]))
t.eo.1 <- t.eo.numerator.1/t.eo.denominator.1

#let's check what R has to say to verify our t-score...
t.test(keewee.diff[,1])


#all t-scores at once!
t.eo.tops <- apply(keewee.diff,2,mean)
t.eo.bottoms <- apply(keewee.diff,2,sd) / sqrt(nrow(keewee.diff))
all.the.ts <- t.eo.tops / t.eo.bottoms













